home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / nroff~06.zoo / makefile < prev    next >
Makefile  |  1992-09-11  |  9KB  |  394 lines

  1. # note this version of makefile fixes a few glitches and adds gversion...
  2.  
  3. FIXSTK=fixstk 64K
  4. GVERSION=gversion -v 1.2.1
  5.  
  6. #----------------------------------------------------------------------------
  7. # makefile for nroff 07/15/92 wjr. this makefile _SHOULD_ handle minix, tos,
  8. # and unix. PLEASE READ THE ENTIRE MAKEFILE BEFORE YOU MAKE! this is the GNU
  9. # C version.
  10. #
  11. # this makefile was designed for my own make(1) and may not work correctly
  12. # with minix. but then i don't have to worry about 64k limits so it can be
  13. # more robust. it should work with any reasonable make, though. nothing fancy
  14. # here...
  15. #
  16. # please look at the makefile first to customize it to your environment.
  17. #----------------------------------------------------------------------------
  18. # $Id: makefile.,v 1.2 1992/07/16 11:56:10 rosenkra Exp $
  19. #
  20. # $Log: makefile.,v $
  21. # Revision 1.2  1992/07/16  11:56:10  rosenkra
  22. # port to gcc
  23. #
  24. #----------------------------------------------------------------------------
  25. #
  26. # MACRO DEFINITIONS:
  27. #
  28.  
  29. # version (3 digits max):
  30. #
  31. VER        = 120
  32.  
  33. # compiler:
  34. #
  35. CC        = gcc -v -z -Wall -Ig:/mint/include
  36. LD        = gcc -v -z -Wall -Lg:/mint/lib
  37.  
  38. # rename:
  39. #
  40. RENAME        = cp -p
  41. #RENAME        = entab
  42.  
  43. # install:
  44. #
  45. INSTALL        = cp -p
  46.  
  47. #
  48. # main target:
  49. #
  50. # for tos, make this ".ttp", otherwise blank
  51. #
  52. EXTN        = .ttp
  53.  
  54. # for testing, use "x", otherwise blank
  55. #
  56. XTST        = x
  57. TARGET        = $(XTST)nroff$(EXTN)
  58.  
  59. # manual page names:
  60. #
  61. # section of the manual (generally always "1")
  62. #
  63. SECTN        = 1
  64. MANSRC        = nroff.man
  65. CATPAGE        = nroff.cat
  66. MANPAGE        = nroff.$(SECTN)
  67. SECTN_an    = 7
  68. MANSRC_an    = man.man
  69. CATPAGE_an    = man.cat
  70. MANPAGE_an    = man.$(SECTN_an)
  71. SECTN_s        = 7
  72. MANSRC_s    = ms.man
  73. CATPAGE_s    = ms.cat
  74. MANPAGE_s    = ms.$(SECTN_s)
  75.  
  76. # compile flags:
  77. #
  78. # for different versions, use only one of the following sets in VERSFLAGS:
  79. # tos:        -Dtos -Dalcyon
  80. # minix ST:    -Dminix -DatariST
  81. # minix PC:    -Dminix
  82. # unix:        -Dunix
  83. #
  84. # DEBUG can be "-g" under unix and OPTIMIZE can be "-O"
  85. # note that minix may need other flags as well (i don't have minix)
  86. #
  87. ARCH        = -mshort
  88. VERSFLAGS    = -Dtos #-Dalcyon
  89. DEFS        = -DUSE_STDIN -UUSE_PROTOTYPES -DNO_CR -DDO_HYPH
  90. DEBUG        = #-g
  91. OPTIMIZE    = -O -fomit-frame-pointer
  92. PROF        = #-pg
  93. CFLAGS        = $(ARCH) $(DEFS) $(VERSFLAGS) $(DEBUG) $(OPTIMIZE)
  94.  
  95. # link flags:
  96. #
  97. # for alcyon/tos, i use "-s -stksiz" for SYMB, others may vary
  98. #
  99. SYMB        =
  100. LDOPT        = -nostdlib g:/mint/lib/crt0.o
  101. LDFLAGS        = $(SYMB) $(ARCH) $(DEBUG) $(PROF) $(LDOPT)
  102.  
  103. # source files:
  104. #
  105. HEADERS        = config.h nroff.h version.h
  106. SRCS1        = main.c command.c text.c io.c
  107. SRCS2        = macros.c strings.c escape.c low.c dev.c hyph.c
  108. SRCS        = $(SRCS1) $(SRCS2)
  109.  
  110. # object targets:
  111. #
  112. # for normal systems (i.e. sun,apollo,hp,ibm,cray,etc):    O=o
  113. # for minix (ACK is right!):                O=s (SHEESH!!!)
  114. O        =o
  115. OBJS        = main.$O command.$O text.$O io.$O macros.$O strings.$O \
  116.         escape.$O low.$O dev.$O hyph.$O
  117.  
  118. # other files in the distribution:
  119. #
  120. TESTS        = test.0
  121. OTHERS        = README MANIFEST Makefile nroff.man man.man ms.man \
  122.         tmac.an tmac.s $(TESTS)
  123.  
  124. # linked libraries:
  125. #
  126. # for alcyon/tos, i use "-lc"
  127. #
  128. #LIBS        = -ltermcap16 -lgnu16
  129. LIBS        = -lgnu16
  130.  
  131. # arc archive:
  132. #
  133. ARCFILE        = nroff$(VER).arc
  134.  
  135. # executable uuencoded:
  136. #
  137. UUEFILE        = nroff$(VER).uue
  138.  
  139. # shar files:
  140. #
  141. SHARFLG        = -a
  142. SHARF1        = nroff$(VER).01
  143. SHARF2        = nroff$(VER).02
  144. SHARF3        = nroff$(VER).03
  145. SHARF4        = nroff$(VER).04
  146. SHARF5        = nroff$(VER).05
  147. SHARFILE    = nroff$(VER).shr
  148.  
  149. # macro library files:
  150. #
  151. MAN_MACRO    = tmac.an
  152. MS_MACRO    = tmac.s
  153. #ME_MACRO    = tmac.e
  154.  
  155. # final locations for things:
  156. #
  157. # set these as per your system (for "make install")
  158. # tos:        TMACDIR = c:\lib\tmac        (for tmac.an)
  159. #         BINDIR  = c:\bin        (for nroff)
  160. #         MANDIR  = c:\man\man$(SECTN)    (for nroff.1)
  161. # minix:    TMACDIR = /usr/lib/tmac
  162. #         BINDIR  = /usr/bin
  163. #         MANDIR  = /usr/man/man$(SECTN)
  164. # unix:        TMACDIR = /usr/local/lib/tmac
  165. #         BINDIR  = /usr/local/bin
  166. #         MANDIR  = /usr/local/man/man$(SECTN)
  167. #
  168. TMACDIR        = c:\lib\tmac
  169. BINDIR        = c:\bin
  170. MANDIR        = d:\usr\man\man$(SECTN)
  171. MANDIR_an    = d:\usr\man\man$(SECTN_an)
  172. MANDIR_s    = d:\usr\man\man$(SECTN_s)
  173.  
  174. # system path seperator:
  175. #
  176. # note that my make under tos uses <space>\ for line continuation so i can't
  177. # put a space after the "=".
  178. # for tos, use:        S=\         (NO SPACES!!!)
  179. # for minix, unix, use:    S=/
  180. #
  181. S        =/
  182.  
  183. # testing:
  184. #
  185. # make sure to "setenv TMACDIR ." first...
  186. #
  187. RUNPARM        = -man test.0
  188. RUNOUT        = >test.out
  189.  
  190. # a non-objecting rm command:
  191. #
  192. # unix/minix:    RM = rm -f
  193. RM        = rm -f
  194.  
  195. .SUFFIXES:    .man .cat
  196.  
  197. .man.cat:
  198.     nroff -manx -T -rO1 $< >$@
  199.  
  200.  
  201. #----------------------------------------------------------------------------
  202. #
  203. # ACTIONS:
  204. #
  205.  
  206.  
  207. # directions for making things is default target...
  208. #
  209. directions:
  210.         @echo Please read the README file first. Also review makefile.
  211.         @echo Type "make all" to build $(TARGET)
  212.         @echo Type "make manpage" to build $(MANPAGE)
  213.         @echo Type "make install" to build/install $(TARGET)
  214.         @echo Type "make test" to test $(TARGET)
  215.         @echo Type "make clean" to remove objects
  216.         @echo Type "make clobber" to remove objects and $(TARGET)
  217.         @echo Type "make arc" to make source archive $(ARCFILE)
  218.         @echo Type "make shar" to make source shar file $(SHARFILE)
  219.         @echo Type "make uue" to make uuencoded $(TARGET) $(UUEFILE)
  220.  
  221.  
  222.  
  223. # make main target...
  224. #
  225. all:        $(TARGET)
  226.  
  227. $(TARGET):    $(OBJS)
  228.         $(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
  229.         $(GVERSION) $(TARGET)
  230.         $(FIXSTK) $(TARGET)
  231.         @echo "done making $(TARGET)"
  232.  
  233.  
  234.  
  235. # make installable manpage...
  236. #
  237. # you may have to change this. i keep my manpages pre-nroffed so i use
  238. # CATPAGE as my manpage. your man(1) may use nroff to display manpages,
  239. # so you may want to do this instead:
  240. #
  241. # manpage:    $(MANPAGE) $(MANPAGE_an)
  242. #
  243. # $(MANPAGE):    $(MANSRC)
  244. #        $(RENAME) $(MANSRC) $(MANPAGE)
  245. #
  246. # $(MANPAGE_an): $(MANSRC_an)
  247. #        $(RENAME) $(MANSRC_an) $(MANPAGE_an)
  248. #
  249. manpage:    $(MANPAGE) $(MANPAGE_an) $(MANPAGE_s)
  250.         @echo "done making manpages"
  251.  
  252. $(MANPAGE):    $(CATPAGE)
  253.         $(RENAME) $(CATPAGE) $(MANPAGE)
  254.  
  255. $(MANPAGE_an):    $(CATPAGE_an)
  256.         $(RENAME) $(CATPAGE_an) $(MANPAGE_an)
  257.  
  258. $(MANPAGE_s):    $(CATPAGE_s)
  259.         $(RENAME) $(CATPAGE_s) $(MANPAGE_s)
  260.  
  261. $(CATPAGE):    $(MANSRC)    # use built-in .man.cat rule
  262.  
  263. $(CATPAGE_an):    $(MANSRC_an)
  264.  
  265. $(CATPAGE_s):    $(MANSRC_s)
  266.  
  267.  
  268.  
  269. # to test run it...
  270. #
  271. test:        $(TARGET)
  272.         $(TARGET) $(RUNPARM) $(RUNOUT)
  273.         @echo "done with test"
  274.  
  275.  
  276. # install target, manpage, and lib stuff...
  277. #
  278. install:    install_bin install_man install_tmac
  279.         @echo "install complete"
  280.  
  281. install_bin:    $(TARGET)
  282.         $(INSTALL) $(TARGET) $(BINDIR)$S$(TARGET)
  283.         @echo "done installing $(TARGET)"
  284.  
  285. install_man:    $(MANPAGE) $(MANPAGE_an) $(MANPAGE_s)
  286.         $(INSTALL) $(MANPAGE) $(MANDIR)$S$(MANPAGE)
  287.         $(INSTALL) $(MANPAGE_an) $(MANDIR_an)$S$(MANPAGE_an)
  288.         $(INSTALL) $(MANPAGE_s) $(MANDIR_s)$S$(MANPAGE_s)
  289.         @echo "done installing manpages"
  290.  
  291. install_tmac:
  292.         $(INSTALL) $(MAN_MACRO) $(TMACDIR)$S$(MAN_MACRO)
  293.         $(INSTALL) $(MS_MACRO) $(TMACDIR)$S$(MS_MACRO)
  294. #        $(INSTALL) $(ME_MACRO) $(TMACDIR)$S$(ME_MACRO)
  295.         @echo "done installing macro packages"
  296.  
  297.  
  298.  
  299. # clean up...
  300. #
  301. clean:
  302.         $(RM) $(OBJS) errs
  303.  
  304. clobber:
  305.         $(RM) $(OBJS)
  306.         $(RM) $(TARGET)
  307.  
  308. cleansrc:
  309.         $(RM) $(SRCS) $(HEADERS)
  310.  
  311. cleandocs:
  312.         $(RM) docs.arc readme bugs $(MANPAGE) $(MAN_MACRO) $(MS_MACRO)
  313.  
  314.  
  315.  
  316. # various archives...
  317. #
  318. uue:
  319.         $(UUENCODE) $(TARGET)
  320.         @echo done making $(UUEFILE)
  321.  
  322. shar:        uue
  323.         $(SHAR) $(SHARFLG) $(OTHERS) >$(SHARF1)
  324.         $(SHAR) $(SHARFLG) $(SRCS1) >$(SHARF2)
  325.         $(SHAR) $(SHARFLG) $(SRCS2) >$(SHARF3)
  326.         $(SHAR) $(SHARFLG) $(HEADERS) >$(SHARF4)
  327.         $(SHAR) $(SHARFLG) $(UUEFILE) >$(SHARF5)
  328.         @echo done making $(SHARF1) $(SHARF2) $(SHARF3) $(SHARF4) $(SHARF5)
  329.  
  330. arc:
  331.         $(ARC) a $(ARCFILE) $(OTHERS)
  332.         $(ARC) a $(ARCFILE) $(HEADERS)
  333.         $(ARC) a $(ARCFILE) $(SRCS)
  334.         @echo done making $(ARCFILE)
  335.  
  336.  
  337.  
  338. # the following actions i use while developing so i can save disk space.
  339.  
  340. # use this to save space on disk
  341. #
  342. backup:        objs.arc srcs.arc docs.arc
  343.  
  344. objs.arc:
  345.         $(ARC) a objs.arc $(OBJS) $(TARGET)
  346.         @echo done making objs.arc. consider "make clean"
  347.  
  348. srcs.arc:
  349.         $(ARC) a srcs.